package com.zhentao.controller;

import com.zhentao.pojo.Hospital;
import com.zhentao.service.IHospitalService;
import com.zhentao.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mp
 * @since 2025-03-26
 */
@RestController
@RequestMapping("/hospital")
public class HospitalController {
@Autowired
    IHospitalService service;
@PostMapping("list")
    public Result list(){
    List<Hospital> list = service.list();
    return (list!=null && list.size()>0)?Result.OK(list):Result.ERROR();
}
}
